{% extends 'SyliusAdminBundle::layout.html.twig' %}

{% import 'SyliusUiBundle:Macro:headers.html.twig' as headers %}

{% set definition = resources.definition %}
{% set data = resources.data %}
{% set event_prefix = metadata.applicationName ~ '.admin.' ~ metadata.name ~ '.index' %}

{% set header = configuration.vars.header|default(metadata.applicationName~'.ui.'~metadata.pluralName) %}

{% block title %}{{ header|trans }} {{ parent() }}{% endblock %}

{% block content %}
{{ sonata_block_render_event(event_prefix ~ '.before_header', {'resources': resources}) }}

{% include '@SyliusAdmin/Crud/Index/_header.html.twig' %}

{{ sonata_block_render_event(event_prefix ~ '.after_header', {'resources': resources}) }}

{% include '@SyliusAdmin/Crud/Index/_content.html.twig' %}

{{ sonata_block_render_event(event_prefix ~ '.after_content', {'resources': resources}) }}
{% endblock %}

{% block stylesheets %}
    {{ parent() }}

    {{ sonata_block_render_event(event_prefix ~ '.stylesheets') }}
{% endblock %}

{% block javascripts %}
    {{ parent() }}

    {{ sonata_block_render_event(event_prefix ~ '.javascripts') }}
{% endblock %}
